welcome to another module collecting data from APIs we are going to use Yahoo Finance as an example For particular website, you may find out there are particular APIs to enable you to connect the data, such as Twitter In this example because we are going to use Yahoo Finance so we need to install these extra packages and those extra packages are so uncommon even Google Collaboratory do not have them directly so you have to use this !pip install to go and get those packages installed so that will be something extra for you to know don't be surprised that sometimes you have to use a !pip install to get some extra help once you have these installed you are able to do import yfinance as yahooFinance then you can go and check use the Ticker because the ticker is you assign a label to that Yahoo Finance and then you can retrieve all the information for that label represented company in this example we are using Google's information so the label you can use is "GOOGL" and then you can find out all these labels just by searching Yahoo Finance for example we have Amazon we have Facebook we have Google and we have Microsoft they are representing different companies however it is hard for us to digest it directly for example Google info we have information and they are the entire dictionary we have the zip code we have the sector we have the communication and we have the full time employees so on and so forth so there are a lot of information in there and basically it is hard to do and hard to analyze so the easier way for us to do is using again the dictionary slicing or if we just want to know the sector we go to the key as sector and then we can get an information of the sector if we want to know the price earning ratio there is a there is a specific key for that earning ratio if we want to know the beta then we just go for the beta information as we can see here so those keys you can search and find out right here and it will give you all kinds of keys and then you just need to search for the information particularly interest you and we can actually go and print out all the keys and information pair as we Learned in the dictionary data structure so we have a key and the value pair and we printing them out and separating them with column and then we can see that all the information now is in a much more readable way and we can go on and on and we can see that there are quite a lot so those are the information embedded in Yahoo Finance we can also do something really interesting that is rather than just the info we can get to the history the info gives you the current snapshot of that company and the history gives you the accumulated information for the past of that company and from that Google info we can actually go from the history parts history attribute of that info and we can set up a period as a max which means that we need all the information from the beginning to today for Google's information and then we can see that for that history information we actually have very few columns we have only the open and the high and the low and the close and the volume which are corresponding to the transaction on certain days and we actually have all the dates from the first day Google can trade their stocks up to these dates when we try to retrieve information and we can pass all the information using datetime so that later on we can do time series analysis and then we can see that for here we have we have the starting date of 2012 up to certain that we need because we can specify the start and end so that if we just want to focus on certain period of time we can do so and then pass that to the history, specifying the start and the end and actually we can compare multiple companies so we just learned we can download the Google, and the Google history and we can actually download multiple ones such as Amazon and Google together and starts and ended together and also we can group by the ticker so that we can compare them side by side this is the Amazon information this is Google information so that you can compare as many as you want for those companies you are interested in and then the last step is to save this CSV because it is a data frame to a CSV file so that we can move on and continue